package cn.jwcat.service.impl;

import cn.jwcat.entity.Advise;
import cn.jwcat.mapper.AdviseMapper;
import cn.jwcat.service.IAdviseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class AdviseServiceImpl extends ServiceImpl<AdviseMapper, Advise> implements IAdviseService {

	@Override
	public List<Advise> inquiry(Advise advise) {
		String status = advise.getStatus();
		String reply = advise.getReply();
		String[] time = advise.getTime();
		String startTime = null;
		String endTime = null;
		if (time != null && time.length != 0) {
			startTime = time[0];
			endTime = time[1];
		}
		return this.baseMapper.inquiry(status, startTime, endTime, reply);
	}
}
